package com.ctshk.common.enums.payment;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * @BelongsProject: ctshk-cloud
 * @BelongsPackage: com.ctshk.rpc.payment.enums
 * @Author: hef
 * @CreateTime: 2021-04-21 11:25
 * @Description: 支付币种
 */
@Getter
@AllArgsConstructor
public enum PayCurrency {
    HKD("HKD", "港币"),
    CNY("CNY", "人民币"),
    USD("USD", "美元");
    private String code;
    private String name;

    public static PayCurrency getByCode(String Code) {
        for (PayCurrency obj : PayCurrency.values()) {
            if (Objects.equals(obj.getCode(), Code)) {
                return obj;
            }
        }
        return null;
    }
}
